package com.cskaoyan.mapper;

import com.cskaoyan.bean.MarketOrderGoods;
import com.cskaoyan.bean.MarketOrderGoodsExample;
import com.cskaoyan.bean.bo.StatGoodBo;
import com.cskaoyan.bean.vo.wxorderlistvoentity.GoodsListEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MarketOrderGoodsMapper {
    long countByExample(MarketOrderGoodsExample example);

    int deleteByExample(MarketOrderGoodsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketOrderGoods record);

    int insertSelective(MarketOrderGoods record);

    List<MarketOrderGoods> selectByExample(MarketOrderGoodsExample example);

    MarketOrderGoods selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketOrderGoods record, @Param("example") MarketOrderGoodsExample example);

    int updateByExample(@Param("record") MarketOrderGoods record, @Param("example") MarketOrderGoodsExample example);

    int updateByPrimaryKeySelective(MarketOrderGoods record);

    int updateByPrimaryKey(MarketOrderGoods record);

    List<StatGoodBo> selectStatGoodsInf();

    /**
     * 通过 订单id 查需要的goods信息
     *
     * @param orderId
     * @return com.cskaoyan.bean.vo.wxorderlistvoentity.GoodsListEntity
     * @author LA
     * @since 2023/01/02 3:44
     */
    List<GoodsListEntity> selectGoodsEntityByOrderId(Integer orderId);

    /**
     * 获取orderGoods表中,当前的最大的comment 值
     *
     * @return java.lang.Integer
     * @author LA
     * @since 2023/01/02 19:37
     */
    Integer selectMaxComment();

    /****
     * 通过订单id 和goodId 查订单商品信息
     * @param orderId
     * @param goodsId
     * @return com.cskaoyan.bean.MarketOrderGoods
     * @author LA
     * @since 2023/01/02 21:53
     */
    MarketOrderGoods selectByOrderIDAndGoodsID(@Param("orderId") Integer orderId, @Param("goodsId") Integer goodsId);
}